Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust: Restore and update attribute highlighting #25501

Merged

Conversation

MrSubidubi
Copy link
Contributor

@MrSubidubi MrSubidubi commented Feb 24, 2025

#25333 added broader highlighting for identifiers, which broke the generic query for attribute queries, resulting in these being highlighted the same as identifiers.

To accomodate for this change, this PR updates the attribute matches to be more specific.

Additionally, path matches in scoped identifiers are no longer highlighted as attributes, as seen in the comparison screenshot. Can revert this if requested.

Zed Preview preview
main main
This PR pr

The generic match for token_tree is needed to recursively match patterns like #[cfg(any(test, feature = "test-support"))] (or at least I was unable to find a better query here). I tried to validate that this does not break any other highlights and I believe it does not. However, I might have still missed something.

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 24, 2025
Copy link
Member

@maxdeviant maxdeviant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@maxdeviant maxdeviant merged commit 113c471 into zed-industries:main Feb 25, 2025
13 checks passed
@MrSubidubi MrSubidubi deleted the rust-attribute-highlights branch February 25, 2025 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants